package com.bua.datafactory;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created with IntelliJ IDEA.
 * User: ningning
 * Date: 13-7-2
 * Time: 下午9:39
 * To change this template use File | Settings | File Templates.
 */
public class DataFactory {
    public int status;
    public String message;
    public JSONObject body;
    public DataFactory(String jsonString)
    {
        try {
            JSONObject Root=new JSONObject(jsonString);
            JSONObject head=Root.getJSONObject("head");

            status=head.getInt("status");
            message=head.getString("message");
            body=Root.getJSONObject("body")   ;
        } catch (JSONException e) {
            status=10000;
            e.printStackTrace();
        }

    }
}
